[#include "../../common/html.ftl" /]

[#-- dbadminer-CSS样式库--]
[#macro head_dbadminer title="DB Adminer" css=[] ]
    [@head title=title css=css ]
        [#if css??]
            [#list css as c]
                [#if c=="codemirror"]
                    <link rel="stylesheet" href="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/codemirror.css?v=${edition}">
                    <link rel="stylesheet" href="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/hint/show-hint.css?v=${edition}" />
                    <link rel="stylesheet" href="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/scroll/simplescrollbars.css?v=${edition}" />
                [/#if]
                [#if c=="db-common"]
                    <link rel="stylesheet" href="${ctx}/osfw/dbadminer/common/common.css?v=${edition}"/>
                [/#if]
                [#if c=="database"]
                    <link rel="stylesheet" href="${ctx}/osfw/dbadminer/database/document-flow.css?v=${edition}"/>
                [/#if]
                [#if c=="sql"]
                    <link rel="stylesheet" href="${ctx}/osfw/dbadminer/sql/sql.css?v=${edition}"/>
                [/#if]
            [/#list]
        [/#if]
        [#-- 自定义CSS --]
        [#nested /]
    [/@head]
[/#macro]


[#-- dbadminer-JS插件库 --]
[#macro script_dbadminer js=[] progress="true" ]
    [@script js=js progress=progress ]
        [#if js??]
            [#list js as j]
                [#if j=="codemirror"]
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/codemirror.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/mode/sql/sql.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/selection/active-line.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/edit/matchbrackets.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/display/fullscreen.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/hint/show-hint.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/hint/sql-hint.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/codemirror/5.65.15/addon/scroll/simplescrollbars.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/framework/ajax/libs/base64/jquery.base64.js?v=${edition}"></script>
                    <script type="text/javascript" src="${ctx}/osfw/dbadminer/sql/formatter.js?v=${edition}"></script>
                [/#if]
                [#if j=="db-common"]
                    <script type="text/javascript" src="${ctx}/osfw/dbadminer/common/common.js?v=${edition}"></script>
                [/#if]
                [#if j=="sql"]
                    <script type="text/javascript" src="${ctx}/osfw/dbadminer/sql/sql.js?v=${edition}"></script>
                [/#if]
                [#if j=="database"]
                    <script type="text/javascript" src="${ctx}/osfw/dbadminer/database/document-flow.js?v=${edition}"></script>
                [/#if]
            [/#list]
        [/#if]
        [#-- 自定义JS --]
        [#nested /]
    [/@script]
[/#macro]


[#--底部数据库操作栏(固定式)--]
[#macro footerToolbar btns=[] ]
    <div class="fw-db-footer" >
        [#-- 公共插件 --]
        [#if btns??]
            [#list btns as btn]
            [#if btn=="operbtns"]
                <div id="fw-footer-operbtns" class="footer-operbtns am-hide">
                    <button id="fw-footer-operbtn-add" class="am-btn am-btn-transparent am-btn-xs" title="添加记录"><i class="am-icon-plus am-icon-fw"></i></button>
                    <button id="fw-footer-operbtn-delete" class="am-btn am-btn-transparent am-btn-xs" title="删除记录"><i class="am-icon-minus am-icon-fw"></i></button>
                    <button id="fw-footer-operbtn-commit" class="am-btn am-btn-transparent am-btn-xs fw-btn-disabled " title="应用更改"><i class="am-icon-check am-icon-fw"></i></button>
                    <button id="fw-footer-operbtn-cancel" class="am-btn am-btn-transparent am-btn-xs fw-btn-disabled" title="放弃更改"><i class="am-icon-close am-icon-fw"></i></button>
                    <button id="fw-footer-operbtn-refresh" class="am-btn am-btn-transparent am-btn-xs " title="刷新"><i class="am-icon-refresh am-icon-fw"></i></button>
                    <button id="fw-footer-operbtn-stop" class="am-btn am-btn-transparent am-btn-xs fw-btn-disabled " title="停止"><i class="am-icon-stop am-icon-fw"></i></button>
                </div>
            [/#if]
            [#if btn=="operinfo"]
                <div id="fw-footer-operinfo" class="footer-operinfo am-hide"></div>
            [/#if]
            [#if btn=="opertime"]
                <div id="fw-footer-opertime" class="footer-opertime am-hide"></div>
            [/#if]
            [#if btn=="pageinfo"]
                <div class="footer-pages">
                    <div id="fw-footer-pageinfo" class="footer-pageinfo am-hide">
                        第 <span class="data-row">0</span> 条记录 (共 <span class="data-total">0</span> 条) 于第<span class="data-page">1</span>页
                    </div>
                    <div id="fw-footer-pagebtns" class="footer-pagebtns am-hide" data-total="0">
                        <button id="page-step-backward" class="am-btn am-btn-transparent am-btn-xs"><i class="am-icon-step-backward am-icon-fw"></i></button>
                        <button id="page-chevron-left" class="am-btn am-btn-transparent am-btn-xs "><i class="am-icon-chevron-left am-icon-fw"></i></button>
                        <button class="am-btn am-btn-transparent am-btn-xs "><input type="text" name="page" value="1" min="1"/></button>
                        <button id="page-chevron-right" class="am-btn am-btn-transparent am-btn-xs "><i class="am-icon-chevron-right am-icon-fw"></i></button>
                        <button id="page-step-forward" class="am-btn am-btn-transparent am-btn-xs "><i class="am-icon-step-forward am-icon-fw"></i><input type="hidden" name="total" value="0"/></button>
                    </div>
                </div>
            [/#if]
            [#if btn=="infoview"]
                <div id="fw-footer-infoview" class="footer-infoview">
                    <button class="am-btn am-btn-transparent am-btn-xs "><i class="am-icon-columns am-icon-fw"></i></button>
                </div>
            [/#if]
        [/#list]
        [/#if]
        [#nested /]
    </div>
[/#macro]


[#macro connectTreeLeft ]
    <div class="fw-tree-left">
        <div class="tree-header">
            <div class="title">
                <i class="am-icon-sitemap"> 组织架构</i>
            </div>
            <div class="treeExpandCollapse">
                <a href="#" onclick="$.tree.expand()">展开</a> /
                <a href="#" onclick="$.tree.collapse()">折叠</a>
            </div>
        </div>
        <div class="tree-wrapper">
            <div id="connect-tree-left" class="ztree"></div>
        </div>
        <a id="tree-foldbar-outdent" class="am-btn am-btn-default am-icon-caret-right am-hide" title="展开"></a>
        <a id="tree-foldbar-indent" class="am-btn am-btn-default am-icon-caret-left" title="折叠"></a>
    </div>
[/#macro]